<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
	<title>Activities</title>
	<link rel="stylesheet" type="text/css" href="css/frame.css" />
	<meta http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT"/>
	<meta http-equiv="Pragma" content="no-cache"/>
	<meta http-equiv="Cache-Control" content="no-cache"/>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
	<meta http-equiv="content-language" content="es"/>
	<script language="javascript" src="js/interlineado.js"></script>
	<script language="javascript" src="involvement/involvement.js"></script>
</head>
<body onLoad="javascript:alternate('involvement');" style="padding-left:4px; padding-bottom:5px;">
	<form id="InvolvementForm" method="post">
	<input id="project" name="project" type="hidden" value="${project.projectKey.id}"/>
	<input id="activity" name="activity" type="hidden" value="${activity.activityKey.id}"/>
		<h2>Activity Contributions</h2>
		
		<h4>Project</h4>
		
		<table class="master-table">
			<tr>
				<td class="master-table-label">Id:</td>
				<td class="master-table-value">${project.projectKey.id}</td>
			</tr>
			<tr>
				<td class="master-table-label">Name:</td>
				<td class="master-table-value">${project.name}</td>
			</tr>
			<tr>
				<td class="master-table-label">Description:</td>
				<td class="master-table-value">${project.description}</td>
			</tr>
		</table>
		
		<h4>Activity</h4>

		<table class="master-table">
			<tr>
		  		<td class="master-table-label">Id:</td>
		  		<td class="master-table-value">${activity.activityKey.id}</td>
			</tr>
			<tr>
			  	<td class="master-table-label">Name:</td>
			  	<td class="master-table-value">${activity.name}</td>
			</tr>
			<tr>
		  		<td class="master-table-label">Description:</td>
		  		<td class="master-table-value">${activity.description}</td>
			</tr>
		</table>
		
		<h4>Involvements</h4>
		
		<display:table name="activityDetail" id="involvement" requestURI="/involvement.list.fc" class="grid" pagesize="${pageSize}" >
			<display:column title="Responsible" headerClass="grid-header" sortable="true">
				<c:out value="${involvement.responsible.name}"/>
			</display:column>
			<display:column title="Beginning" headerClass="grid-header" sortable="true">
				<c:out value="${involvement.beginning}"/>
			</display:column>
			<display:column title="Planned End" headerClass="grid-header" sortable="true">
				<c:out value="${involvement.plannedEnd}"/>
			</display:column>
			<display:column title="Real End" headerClass="grid-header" sortable="true">
				<c:out value="${involvement.realEnd}"/>
			</display:column>
			<display:column title="Action" headerClass="grid-header" style="width:60px; text-align:center;">
					<c:if test="${!empty involvement.realEnd}">
							<input type="image" src="img/finish.png" title="Finish involvement" onclick="if(!loadFinishInvolvementQuestion(${involvement.responsible.personKey.id}))return false;" style="border-width:0px;" />
						</c:if>
						<c:if test="${empty involvement.realEnd}">
							<input type="image" src="img/finish.png" title="Finish involvement" onclick="loadFinishInvolvement(${involvement.responsible.personKey.id});" style="border-width:0px;" />
						</c:if>
						<input type="image" src="img/update.png" title="Update involvement" onclick="loadUpdateInvolvement(${involvement.responsible.personKey.id});" style="border-width:0px;" />
						<input type="image" src="img/delete.png" title="Delete involvement" onclick="if(!deleteInvolvement(${involvement.responsible.personKey.id}))return false;" style="border-width:0px;" />
			</display:column>
		</display:table>
				
		<br/>
		<br/>

		<a title="New involvement" class="link-button" href="javascript:loadCreateInvolvement();">New</a>

		<a class="link-button" href="javascript:back();">Back</a>
	</form>
</body>
</html>